<?php

namespace App\Models;

use App\Helpers\RequestCriteria;
use App\Helpers\BaseModel;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Task extends Model
{
    use HasFactory, RequestCriteria, BaseModel;

    protected $fillable = [
        'name' ,
        'filepath',
        'status',
        'remarks',
        'user_id',
        'status_info',
        'dev_type',
        'dev_id',
        'estimate'
    ];

    protected $casts = [
        'updated_at' => 'datetime:Y-m-d H:i:s',
        'created_at' => 'datetime:Y-m-d H:i:s',
    ];

    public function reports()
    {
        return $this->hasMany(Report::Class);
    }

    public function user()
    {
        return $this->belongsTo(User::Class);
    }

}
